
<!-- 分页 data分页数据 page当前页必须以?或者&结尾 -->
<div >
  <nav id="pagination" aria-label="Page navigation example"  th:if="${data.pages>1}">
      <ui class="flex items-center -space-x-px h-10 text-base list-none">
        <li th:if="${data.pageNum!=1}">
          <a th:href="${niceConfig['oly.web.domain']+page+'?pageNum=1'}"
          class="flex items-center justify-center px-4 h-10 leading-tight text-gray-500 bg-white border border-gray-300 hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"
          >首页</a
          >
        </li>
        <li th:if="${data.pageNum>1}">
          <a
            th:href="${niceConfig['oly.web.domain']+page+'pageSize='+pageSize+'&pageNum='+(data.pageNum-1)}"
            class="flex items-center justify-center px-4 h-10 leading-tight text-gray-500 bg-white border border-gray-300 hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"
          >
            <svg
              class="w-3 h-3 rtl:rotate-180"
              aria-hidden="true"
              xmlns="http://www.w3.org/2000/svg"
              fill="none"
              viewBox="0 0 6 10"
            >
              <path
                stroke="currentColor"
                stroke-linecap="round"
                stroke-linejoin="round"
                stroke-width="2"
                d="M5 1 1 5l4 4"></path>
            </svg>
          </a>
        </li>
        <!--显示1-5页 页数少于5页-->
        <li
          th:if="${data.pages<6}"
          th:each="i:${#numbers.sequence(1,data.pages)}"
        >
          <a
            th:text="${i}"
            th:href="${niceConfig['oly.web.domain']+page+'pageSize='+pageSize+'&pageNum='+i}"
            class="flex items-center justify-center px-4 h-10 leading-tight text-gray-500 bg-white border border-gray-300 hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"
            th:classappend="${data.pageNum==i?'current':''}"></a>
        </li>
        <!--显示中间页 页数大于5页-->
        <li
          th:if="${data.pages>5 and data.pageNum<4}"
          th:each="i:${#numbers.sequence(1,5)}"
        >
          <a
            th:text="${i}"
            th:href="${niceConfig['oly.web.domain']+page+'pageSize='+pageSize+'&pageNum='+i}"
            class="flex items-center justify-center px-4 h-10 leading-tight text-gray-500 bg-white border border-gray-300 hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"
            th:classappend="${data.pageNum==i?'current':''}"></a>
        </li>
        <li
          th:if="${data.pages>5 and (data.pages-data.pageNum)>5 and data.pageNum>3}"
          th:each="i:${#numbers.sequence(data.pageNum-2,data.pageNum+2)}"
        >
          <a
            th:text="${i}"
            th:href="${niceConfig['oly.web.domain']+page+'pageSize='+pageSize+'&pageNum='+i}"
            class="flex items-center justify-center px-4 h-10 leading-tight text-gray-500 bg-white border border-gray-300 hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"
            th:classappend="${data.pageNum==i?'current':''}"></a>
        </li>
        <!--显示最后5页 页数大于5页-->
        <li
          th:if="${data.pageNum>3 and (data.pages-data.pageNum)<6 and (data.pages-data.pageNum)>2}"
          th:each="i:${#numbers.sequence(data.pageNum-2,data.pageNum+2)}"
        >
          <a
            th:text="${i}"
            th:href="${niceConfig['oly.web.domain']+page+'pageSize='+pageSize+'&pageNum='+i}"
            class="flex items-center justify-center px-4 h-10 leading-tight text-gray-500 bg-white border border-gray-300 hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"
            th:classappend="${data.pageNum==i?'current':''}"></a>
        </li>
        <li
          th:if="${data.pages>5 and (data.pages-data.pageNum)<3}"
          th:each="i:${#numbers.sequence(data.pages-4,data.pages)}"
        >
          <a
            th:text="${i}"
            th:href="${niceConfig['oly.web.domain']+page+'pageSize='+pageSize+'&pageNum='+i}"
            class="flex items-center justify-center px-4 h-10 leading-tight text-gray-500 bg-white border border-gray-300 hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"
            th:classappend="${data.pageNum==i?'current':''}"></a>
        </li>
        <li th:if="${data.pageNum<data.pages}">
          <a
            th:href="${niceConfig['oly.web.domain']+page+'pageSize='+pageSize+'&pageNum='+(data.pageNum+1)}"
            class="flex items-center justify-center px-4 h-10 leading-tight text-gray-500 bg-white border border-gray-300 hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"
          >
            <svg
              class="w-3 h-3 rtl:rotate-180"
              aria-hidden="true"
              xmlns="http://www.w3.org/2000/svg"
              fill="none"
              viewBox="0 0 6 10"
            >
              <path
                stroke="currentColor"
                stroke-linecap="round"
                stroke-linejoin="round"
                stroke-width="2"
                d="m1 9 4-4-4-4"></path>
            </svg>
          </a>
        </li>
        <li th:if="${data.pages!=data.pageNum}">
          <a
            th:href="${niceConfig['oly.web.domain']+page+'pageSize='+pageSize+'&pageNum='+data.pages}"
            class="flex items-center justify-center px-4 h-10 leading-tight text-gray-500 bg-white border border-gray-300 hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"
            >尾页</a
          >
        </li>
      </ui>
  </nav>
</div>
